import { BaseWindow } from "../../../component/window/BaseWindow";
import { ILayer } from "../../../mvc/interfaces/ILayer";
import { Language } from "../../../../extend/language/Language";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { DisplayUtil } from "../../../common/DisplayUtil";
import { ConstConfig } from "../../resource/ConstConfig";
import { GScrollPane } from "../../../../com/mui/controls/GScrollPane";
import { ScrollPolicy } from "../../../../fl/controls/ScrollPolicy";
import { RoleEquipInfoPanel } from "../player/equip/RoleEquipInfoPanel";
import { GModuleEvent } from "../../mvc/GModuleEvent";
import { SecondCrareerAttribute } from "./selectSubWin/SecondCrareerAttribute";
import { SecondCareerSelect } from "./selectSubWin/SecondCareerSelect";
import { SecondCareerSkillRune } from "./selectSubWin/SecondCareerSkillRune";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
type int = number;
//class SecondCareerSelectWin
    
    export  class SecondCareerSelectWin extends BaseWindow
    {
        constructor(arg1: ILayer=null)
        {
            super(arg1);
            this.setSize(691, 501);
            this.title = Language.getString(80200);
            this.titleHeight = 27;
            return;
        }

        public updateNeedCoins(arg1: int, arg2: Boolean, arg3: Boolean=false): void
        {
            var loc1=arg1.toString();
            if (arg2) 
            {
                loc1 = HTMLUtil.addColor(loc1, "#FEFDB4");
            }
            else 
            {
                loc1 = HTMLUtil.addColor(loc1, "#ff000");
            }
            if (arg3) 
            {
                this._txtNeedCoin.htmlText = Language.getStringByParam(80612, loc1);
                this._txtNeedCoin.x = 475;
                this._txtNeedCoin.y = 373;
                this._bmpCoin.visible = false;
                this._bmpGold = ObjCreate.createBitmap(ImagesConst.Yuanbao, 623, 373, this);
            }
            else 
            {
                this._txtNeedCoin.htmlText = Language.getStringByParam(80250, loc1);
                this._txtNeedCoin.x = 320;
                this._txtNeedCoin.y = 473;
                this._bmpCoin.visible = true;
                DisplayUtil.removeMe(this._bmpGold);
            }
            return;
        }

        public updateSelectWin(arg1: Array<any>): void
        {
            this._winSelect.updateView(arg1);
            return;
        }

        public updateAttrWin(arg1: Array<any>): void
        {
            this._winAttr.updateView(arg1);
            return;
        }

        public updateSkillRuneWin(arg1: Array<any>): void
        {
            this._winSkillRune.updateData(arg1);
            return;
        }

        public updateRoleEquip(arg1: string, arg2: int, arg3: int, arg4: Array<any>, arg5: int, arg6: int, arg7: int, arg8: Boolean, arg9: Boolean, arg10: Boolean): void
        {
            this._winInfo.updateInfos(arg1, arg3, arg2);
            this._winInfo.setEquipments(arg4, arg3, null, 0, arg5, arg6, arg7, arg8, arg10, arg9);
            return;
        }

        public getCurSelectedCareer(): int
        {
            return this._winSelect.getCurSelectedCareer();
        }

        public set descTips(arg1: string)
        {
            this._txtDesc.htmlText = arg1;
            return;
        }

        protected /* override */ createChildren(): void
        {
            var loc1=null;
            super.createChildren();
            ObjCreate.createBg(17, 36, 490, 62, this);
            this._txtDesc = ObjCreate.createGTextField("", 20, 40, 483, 80, this);
            loc1 = this._txtDesc.defaultTextFormat;
            loc1.leading = 3;
            this._txtDesc.defaultTextFormat = loc1;
            this._txtDesc.multiline = true;
            this._txtDesc.wordWrap = true;
            this._txtDesc.htmlText = Language.getStringByParam(80251, ConstConfig.instance.getValueByName("CareerSecondOpenCost"));
            this._descScrolPane = new GScrollPane();
            this._descScrolPane.x = 20;
            this._descScrolPane.y = 41;
            this._descScrolPane.width = 482;
            this._descScrolPane.height = 54;
            this._descScrolPane.styleName = "GScrollPane";
            this._descScrolPane.verticalScrollPolicy = ScrollPolicy.AUTO;
            this._descScrolPane.horizontalScrollPolicy = ScrollPolicy.OFF;
            this._descScrolPane.source = this._txtDesc;
            this._descScrolPane.scrollDrag = false;
            this._descScrolPane.focusEnabled = false;
            this.addChild(this._descScrolPane);
            this._descScrolPane.update();
            ObjCreate.createBg(17, 101, 252, 310, this);
            this._winInfo = new RoleEquipInfoPanel();
            this._winInfo.mode = GModuleEvent.Mode_PreSecondCareer;
            this._winInfo.x = 17;
            this._winInfo.y = 101;
            this.addChild(this._winInfo);
            var loc2=new Object /* flash.display.Bitmap */(new Object /* flash.display.BitmapData */(252, 309, true, 0));
            this._winAttr = new SecondCrareerAttribute();
            this._winAttr.x = 272;
            this._winAttr.y = 101;
            this.addChild(this._winAttr);
            this._winSelect = new SecondCareerSelect();
            this._winSelect.x = 510;
            this._winSelect.y = 36;
            this.addChild(this._winSelect);
            this._winSkillRune = new SecondCareerSkillRune();
            this._winSkillRune.x = 17;
            this._winSkillRune.y = 414;
            this.addChild(this._winSkillRune);
            var loc3=ObjCreate.createGTextField("", 17, 473, 490, 20, this);
            loc1 = loc3.defaultTextFormat;
            loc1.align = flash.text.TextFormatAlign.CENTER;
            loc1.color = 65280;
            loc3.defaultTextFormat = loc1;
            loc3.htmlText = Language.getString(80201);
            this._txtNeedCoin = ObjCreate.createGTextField("", 320, 473, 200, 20, this);
            loc1 = this._txtNeedCoin.defaultTextFormat;
            loc1.align = flash.text.TextFormatAlign.CENTER;
            this._txtNeedCoin.defaultTextFormat = loc1;
            this._bmpCoin = GlobalClass.getBitmap("Tongqian_bind");
            this._bmpCoin.x = 460;
            this._bmpCoin.y = this._txtNeedCoin.y - 2;
            this.addChild(this._bmpCoin);
            return;
        }

        /* internal */ /* var */_winSelect: SecondCareerSelect;

        /* internal */ /* var */_winAttr: SecondCrareerAttribute;

        /* internal */ /* var */_winSkillRune: SecondCareerSkillRune;

        /* internal */ /* var */_winInfo: RoleEquipInfoPanel;

        /* internal */ /* var */_txtDesc: GTextFiled;

        /* internal */ /* var */_descScrolPane: GScrollPane;

        /* internal */ /* var */_txtNeedCoin: GTextFiled;

        /* internal */ /* var */_bmpGold: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_bmpCoin: Object /* flash.display.Bitmap */;
    }
